package org.jeecg.enums.car;

/**
 * 优惠券详情状态   状态：0 已绑定 1已使用
 */
public enum CarDerateDetailStatusEnum {
    CAR_DERATE_DETAIL_STATUS_0(0, "已绑定"),
    CAR_DERATE_DETAIL_STATUS_1(1, "已使用"),
    ;

    private Integer code;
    private String desc;

    CarDerateDetailStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }


    public static String getDesc(Integer value) {
        CarDerateDetailStatusEnum[] enums = values();
        for (CarDerateDetailStatusEnum typeEnum : enums) {
            if (value.intValue()  == typeEnum.getCode().intValue()) {
                return typeEnum.desc;
            }
        }
        return "";
    }

    public static Integer getValue(String desc) {
        CarDerateDetailStatusEnum[] enums = values();
        for (CarDerateDetailStatusEnum typeEnum : enums) {
            if (typeEnum.getDesc().equals(desc)) {
                return typeEnum.code;
            }
        }
        return null;
    }

}
